package controllers.commands.base
{
	import model.context.ProtocalContext;
	import model.context.base.IContext;
	import model.protocal.base.IProtocol;
	
	import net.NetLoader;

	/**
	 *  发送协议.
	 **/ 
	public class SendProtocalCommand extends BaseCommand
	{
		public function SendProtocalCommand(context:ProtocalContext)
		{
			super();
			this.context = ProtocalContext(context);
		}
		
		override public function execute():void
		{
			var netLoader:NetLoader = new NetLoader();
			var protocal:IProtocol  = ProtocalContext(this.context).protocal;
			netLoader.load(protocal.getProtocalString(), protocal.onResponseHandler);			
		}
	}
}